from turing import M, B, R, L

# Q, Sigma, Gamma, delta, q0, tape
"""
q1 = M({'q', 'p'}, {B, '0', '1'}, {'0', '1'},
       {('q', '0'): ('q', '0', R),
        ('q', '1'): ('p', '0', R),
        ('q', B): ('q', B, R),
        ('p', '0'): ('q', '0', L),
        ('p', '1'): None,
        ('p', B): ('q', '0', L)}, 'q', '0110')

q2 = M({'q', 'p'}, {B, '0', '1'}, {'0', '1'},
       {('q', '0'): ('q', '0', R),
        ('q', '1'): ('p', '0', R),
        ('q', B): ('q', B, R),
        ('p', '0'): ('q', '0', L),
        ('p', '1'): None,
        ('p', B): ('q', '0', L)}, 'q', '1010110')

"""

q3 = M({'q0', 'q1', 'q2', 'qf'}, {B, '0', '1'}, {B, '0', '1'},
       {('q0', '0'): ('q0', '1', R),
        ('q0', '1'): ('q1', '1', R),
        ('q0', B): ('qf', B, R),
        ('q1', '0'): ('q2', '0', L),
        ('q1', '1'): ('q2', '1', L),
        ('q1', B): ('q2', B, L),
        ('q2', '1'): ('q0', '0', R),
       }, 'q0', '1100')
